package servlet;

public class LagouServlet extends HttpServlet {

    @Override
    public void doPost(Request request, Response response) throws Exception {
        System.out.println("============》doPost请求执行中");
        String context = "<h1>LagouServlet->POST</h1>";
        response.outPut(HttpProtocolUtil.getResponseHeader200(context.getBytes().length)+context);
    }

    @Override
    public void doGet(Request request, Response response) throws Exception {
        System.out.println(request.getUrl()+"---->doGet请求执行中");
        String context = "<h1>LagouServlet->GET</h1>";
        response.outPut(HttpProtocolUtil.getResponseHeader200(context.getBytes().length)+context);
    }

    @Override
    public void init() throws Exception {

    }

    @Override
    public void destory() throws Exception {

    }
}
